var folderInitState = {
    folderList: [],
    newFolder: false,
    errorTip: '',
    activeFolder: '',
    deleteFolder: false,
    renameFolder: false,
    renameError: ''
};

export default function (state = folderInitState, action) {
    switch(action.type){

        case 'GET_FOLDER': 
            return {...state, folderList: action.folderList};
            
       case 'NEW_FOLDER':
            return {...state, newFolder: action.newFolder};

       case 'ERROR_TIP':
            return {...state, errorTip: action.errorTip};

       case 'ACTIVE_FOLDER':
            return {...state, activeFolder: action.activeFolder}  

        case 'DELETE_FOLDER':
            return {...state, deleteFolder: action.deleteFolder}

        case 'RENAME_FOLDER':
            return {...state, renameFolder: action.renameFolder}  

        case 'RENAME_ERROR':
            return {...state, renameError: action.renameError}  
                 
        default:
            return state;
    }
}